fix: improve chat retrieval fallback and query expansion(챗봇 검색 실패 보완 및 질문 표현 처리 개선)#27
Merged
1024andrew merged 2 commits intodevfrom May 3, 2026
Merged
fix: improve chat retrieval fallback and query expansion(챗봇 검색 실패 보완 및 질문 표현 처리 개선)#271024andrew merged 2 commits intodevfrom
1024andrew merged 2 commits intodevfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements a query expansion and rewriting mechanism to enhance the RAG-based chat service. Key changes include adding configuration for query rewriting, integrating expansion logic into the retrieval flow with specific triggers and fallback strategies, and transitioning the answer generator to a structured JSON output for improved source tracking. Feedback suggests adding a timeout to the OpenAI API calls for increased stability and refining the JSON extraction logic from LLM responses using regular expressions to handle potential surrounding text more robustly.
Contributor
|
수고하셨습니다! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
유형
작업 배경
사용자가 DB에 저장된 표현과 다르게 질문하면 관련 정보를 제대로 찾지 못하는 문제가 있었습니다.
예시:
음료수 같은 거 살만한 곳 있나?간단하게 뭐 먹을만한 곳?방에서 라면 끓여먹어도 돼?기숙사 통금 언제야?새벽 2시에 들어가도 돼?전자레인지 어디 있어?또한
dormitory = null인 비로그인 사용자의 경우 검색 범위가 넓어져 답변 품질과 출처 정확도가 떨어지는 문제가 있었습니다.변경 사항
query_rewriter.py추가음료수 살만한 곳→편의점,매점,구매 위치키워드 보강query expansion 설정값 추가
chat_query_rewrite_enabledchat_query_rewrite_modelchat_query_rewrite_temperaturechat_retrieval_method_query_expansionchat_retrieval_version_query_expansion검색 실패 시 query expansion fallback 적용
명확한 intent 질문에 사전 query expansion 적용
dormitory = null비로그인 사용자 검색 흐름 개선no-answer 판정 개선
관련 정보를 찾을 수 없습니다.가 포함되면NO_ANSWER로 처리source_url제거답변 출처 선택 개선
used_reference_index를 기준으로 실제 답변에 사용한 참고 정보의 출처를 선택테스트
Swagger에서 아래 케이스를 확인했습니다.
음료수 같은거 살만한 곳 있나?+제1학생생활관방에서 라면 끓여먹어도 돼?+dormitory = null기숙사 통금 언제야?+제1학생생활관새벽 2시에 들어가도 돼?+제2학생생활관간단하게 뭐 먹을만한 곳?+제1학생생활관전자레인지 어디 있어?+ 생활관별 케이스기대 효과
후속 개선 사항
스크린샷